<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.base.role.Role" %>
<%@page import="com.base.role.RoleService" %>
<%  response.addDateHeader("Expires", 0);response.setHeader("Pragma","no-cache"); response.setHeader("Cache-Control","no-cache");%>
<%
    request.setCharacterEncoding("UTF-8");
	String roleId = request.getParameter("roleId");
    if(roleId == null) roleId = "";
    
    Role role = RoleService.loadRole(request, response, out);
%>

<html>
<head>
	<title>权限管理</title>
	<style type="text/css">
		td {font-family:"宋体";font-size:12px;}
		.template_group_tborder1 {border:#000000 solid;background-color:#F2F2F2;border-width:0 1 1 1; }
		.ftab_left {
		  background-color: #FCFCFE;
		  cursor: hand;
		  background-image:url('../../img/tab/tab_focus_left.gif');
		  background-repeat: no-repeat;
		  background-position:left top;
		  position:relative;
		  top:2px;
		  width:10px;
		  display:inline;
		  float:left;
		  overflow:hidden;
		  FONT-SIZE: 9pt
		}
		.ftab_mid {
		  background-color: #FCFCFE;
		  cursor:hand;
		  background-image:url('../../img/tab/tab_focus_mid.gif');
		  background-repeat: repeat;
		  background-position:left top;
		  position:relative;
		  top:2px;
		  display:inline;
		  float:left;
		  overflow:hidden;
		  FONT-SIZE: 9pt;
		}
		
		.ftab_right {
		  background-color: #FCFCFE;
		  cursor: hand;
		  width:10px;
		  background-image:url('../../img/tab/tab_focus_right.gif');
		  background-repeat: no-repeat;
		  background-position:left top;
		  position:relative;
		  top:2px;
		  display:inline;
		  float:left;
		  overflow:hidden;
		  FONT-SIZE: 9pt
		}
		.ftab_right_share {
		  background-color: #FCFCFE;
		  cursor: hand;
		  width:10px;
		  background-image:url('../../img/tab/tab_focus_right0.gif');
		  background-repeat: no-repeat;
		  background-position:left top;
		  position:relative;
		  top:2px;
		  display:inline;
		  float:left;
		  overflow:hidden;
		  FONT-SIZE: 9pt
		}
		.ntab_left {
		  background-color: #FCFCFE;
		  cursor: hand;
		  background-image:url('../../img/tab/tab_normal_left.gif') ;
		  background-repeat: no-repeat;
		  background-position:left top;
		  position:relative;
		  top:2px;
		  width:10px;
		  z-index:3;
		  FONT-SIZE: 9pt
		}
		.ntab_mid {
		  background-image:url('../../img/tab/tab_normal_mid.gif');
		  background-repeat: repeat;
		  background-position:  left top;
		  cursor: hand;
		  position:relative;
		  top:2px;
		}
		.ntab_right {
		  background-image:url('../../img/tab/tab_normal_right.gif');
		  background-repeat: no-repeat;
		  background-position:  left top;
		  cursor: hand;
		  position:relative;
		  top:2px;
		  width:10px
		}
		.ntab_right_share {
		  background-image:url('../../img/tab/tab_normal_right0.gif');
		  background-repeat: no-repeat;
		  background-position:  left top;
		  cursor: hand;
		  position:relative;
		  top:2px;
		  width:10px
		}
		
		.tab_bottom {
		  background-image:url('../../img/tab/tab_bottom.gif');
		  background-repeat: repeat;
		  background-position:  left top;
		  position:relative;
		  top:2px;
		}
		</style>
	<link href="../../css/table.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../js/tabControl.js"></script>
	<script type="text/javascript">
	 function init() {
		   if("" != "<%=roleId%>") { // 修改
		   }
	   }
	   // 提交
	   function doSubmit(){
	   }

		function validate(){
	   }
	   
	   function showError(error){
		   alert(error);
	   }

	   function showInfo(info){
		   alert(info);
		   window.returnValue = "ok";
		   window.close();
	   }

	   var curPage = 0;
		  var isChanged = [false, false];// 页面内容是否改变,有页签iframe中设置
		  var tabWin = null;// 具体页签页面对象
		  var isPageLoaded = [false, false];
		  var pageIframe = ["ei", "ed"];
		  var pageURL = ["role_acl_menu.jsp", "role_acl_org.jsp"];
	   function init(){
		    var ids = ['t1', 't2'];
		    var titles = ['菜单权限', '单位权限'];
		    var funcNames = 'selectPage';
		    var tabObj= new TabCtr(ids, titles, funcNames, 25, '100%', tabcontainer);
		    tabObj.setActive(0);
		    reloadpage(0);
		  }

	   function selectPage(){
			  	var pageIndex = parseInt(event.srcElement.getAttribute('tindex'));
			    var contentTabs = window.contentTab;
			  	if(isChanged[curPage]){
			  		var info = tabObj.getTab(curPage).innerText;
			  		if(window.confirm(info + "已修改，需要保存吗？") && tabWin){
			  			tabWin.doSubmit('apply');
				 		isChanged[curPage] = false;
						showPage(pageIndex);
						curPage = pageIndex;
				 		return;
			  		}else {
				 		isChanged[curPage] = false;
						curPage = pageIndex;
					    showPage(pageIndex);
			  		}
			  	}else {
				    showPage(pageIndex);
				  	curPage = pageIndex;
					reloadpage(curPage);
			  	}
			  }
			  
	  // 按照页签号显示页签页面
	  function showPage(index){
	  	  var contentTabs = window.contentTab;
	  	  for(var i = 0; i < contentTabs.length; i++) {
	  	  	  reloadpage(index);
		      contentTabs[i].style.display = (i == index ? "" : "none");
	     }
	  }
			  
	  // 切换页签：后台保存后调用,确保信息保存后再切换页签
	  function changePage(){
	  	reloadpage(curPage);
	  }
	  
	  function reloadpage(pageIndex){
	  	if(!isPageLoaded[pageIndex]){
	  		eval(pageIframe[pageIndex]).location = pageURL[pageIndex];
	  		isPageLoaded[pageIndex] = true;
	  	}
		isChanged[pageIndex] = false;
	  }
	  
	  function resetPageLoaded(){
	  	for(var i = 0; i < isPageLoaded.length; i++) {
	      isPageLoaded[i] = false;
	    }
	  }
	  
	  function showWaiter(){
	  	document.getElementById("waiter").style.display = "";
	  }
	  
	  function hiddenWaiter(){
	    document.getElementById("waiter").style.display = "none";
	  }
	  
	  function setChangeStatus(win,status){// win 页签页面对象
	  	isChanged[curPage] = status;
	  	tabWin = win;
	  }
	</script>
</head>
<body  rightmargin="0" bottommargin="0" leftmargin="0" topmargin="0" onclick="clickBody();" onload="init();">
<table width=600px height=100% border=0 cellspacing=0 cellpadding=0 align="center" style="table-layout:fixed">
  <tr>
    <td align=center valign="top" style="padding-top: 8px">
      <table width=97% height="98%" cellspacing=0 cellpadding=0 border=0>
		<tr>
          <td height="25px">
		  <div id='tabcontainer'></div>
		  </td>
        </tr>
        <tr height="100%">
          <td height="100%" width=100% class="template_group_tborder1" align="center">
            <!--专家信息-->
            <table width=100% height=100% cellSpacing=0 cellPadding=0 style="display:" id="contentTab">
              <tr>
                <td>
				<iframe name=ei src="#" width=100% height=100% scrolling=no frameBorder=0></iframe>
                </td>
              </tr>
            </table>

            <!--专家文档-->
            <table width=100% height=100% cellSpacing=0 cellPadding=0 style="display:none" id="contentTab">
              <tr height=100%>
                <td width=100%>
                  <iframe name=ed src="#" width=100% height=100% scrolling=no frameBorder=0></iframe>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>